package com.gxa.service.impl;

import com.gxa.common.R;
import com.gxa.mapper.EmpMapper;
import com.gxa.pojo.Emp;
import com.gxa.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: wangyifan
 * @Date: 2021/11/29 18:34
 * @Description: $end$
 * @Version: V1.0
 */
@Service
public class EmpServiceImpl implements EmpService{

    @Autowired(required = false)
    private EmpMapper empMapper;
    @Override
    public R queryEmp(Integer currentPage,Integer pageSize) {
        R r = new R();
        Integer params1= (currentPage-1)*pageSize;
        Integer params2= pageSize;
        List<Emp> empList = empMapper.queryEmp(params1,params2);
        r.setCode(200);
        r.setMsg("查询成功");
        r.setData(empList);
        return r;
    }
}
